package com.ljc.www.rabbitmq;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


/**
 * 消息生产者/提供者
 */
@Component
public class Sender {

    @Autowired
    private AmqpTemplate amqpTemplate;
    /**
     * 发送消息
     * @param msg
     */
    public void send(String msg){
        amqpTemplate.convertAndSend("rabbit-mq",msg);
    }
}
